package cn.zhentao.controller;

import cn.zhentao.book.pojo.TBookType;
import cn.zhentao.book.pojo.TPress;
import cn.zhentao.common.Result;
import cn.zhentao.service.TBookTypeService;
import cn.zhentao.service.TPressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 书的类型和出版社
 */
@RestController
@RequestMapping("type_Press")
public class BookOrTypeOrPressContro {
    @Autowired
    private TPressService tPressService;
    @Autowired
    private TBookTypeService bookTypeService;
    //书的类型查询所有
    @GetMapping("booktypelist")
    public Result booktypelist(){
        List<TBookType> list = bookTypeService.list();
        return Result.OK(list);
    }
    //书的出版社查询所有
    @GetMapping("bookpresslist")
    public Result bookpresslist(){
        List<TPress> list = tPressService.list();
        return Result.OK(list);
    }
}
